<template>
	<BaseContainer>
		<aplid-base-crud
			ref="crud"
			class="w-100"
			v-bind="baseConfig"
			:paramsObj="{
				...nowRowData,
			}"
			:operateFormate="operateFormate"
			:formConfig="formConfig"
			:auth="isCondition ? {} : baseConfig.auth"
			:menuBtn="isCondition ? baseConfig.menuDefault : baseConfig.menuBtn"
		>
			<template v-slot:ArchivesDialog="{ row, show }">
				<Archives :api="baseConfig.api" v-if="show" :nowRowData="row"> </Archives>
			</template>
		</aplid-base-crud>
	</BaseContainer>
</template>

<script setup lang="ts">
import { baseConfig, editFormConfig } from './config'
import Archives from '@/views/instOperate/components/ApplyReport/oldman/Archives/index.vue'

const props = defineProps<{
	nowRowData?: any
	isCondition?: boolean
}>()

const formConfig: any = ref(baseConfig.formConfig)

const operateFormate = (row, type) => {
	return new Promise((resolve, reject) => {
		formConfig.value = type == 'edit' ? editFormConfig : baseConfig.formConfig
		resolve(row)
	})
}
</script>

<style lang="scss" scoped></style>
